package com.weiqiao.report.distributior.repository.impl;

import com.weiqiao.base.dao.impl.BaseMongoDaoImpl;
import com.weiqiao.report.distributior.repository.IUserRepository;
import org.bson.conversions.Bson;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("UserReportRepositoryImpl")
public class UserRepositoryImpl extends BaseMongoDaoImpl implements IUserRepository {

    private final static String collectionName = "app_user_ext_";

    @Override
    public List<String> getAppUserByFilterSortSkipLimit(Bson filter, Bson sort, int skip, int limit, int company_id) {
        return super.findFilterSortSkipLimit(collectionName + company_id, filter, sort, skip, limit);
    }

    @Override
    public List<String> getPage(int company_id, Bson filter, Pageable pageable) {
        return super.getListAndPage(collectionName + company_id, filter, pageable);
    }

    @Override
    public int countFruiter(int company_id, Bson filter) {
        return super.statististics(collectionName + company_id, filter);
    }

    @Override
    public List<String> getUserList(int company_id, Bson filter) {
        return super.findFilter(collectionName + company_id, filter);
    }

    @Override
    public String getOne(int company_id, Bson filter) {
        return super.findOne(collectionName + company_id, filter);
    }
}
